<template>
	<view class="background">
		<view class="block" v-for="item in list">
			<view>
				{{item.time}}
			</view>
			<view>
				{{item.position}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		methods: {
			getTaskList() {
				uni.request({
					url: 'http://localhost:8080/merchant/rescueTask/list',
					method: 'GET',
					header: {
						'Authorization': 'Bearer ' + wx.getStorageSync('token')
					},
					success: (resp) => {
						console.log(resp.data)
						console.log(resp)
						this.list = resp.data.rows
						if (this.list == null) {
							uni.showToast({
								title: '没有救援记录',
								icon: 'none'
							})
							// setTimeout(function() {
							// 	uni.navigateBack(1)
							// }, 1500)
						}
					}
				})

			}
		},
		mounted() {
			this.getTaskList()
		}
	}
</script>

<style>
	.background {
		background-color: white;
		padding-left: 20rpx;
	}

	.block {
		border-bottom: 1rpx #e6e6e6 solid;
		padding-bottom: 10rpx;
		padding-top: 20rpx;
		width: 690rpx;
		font-weight: 600;
	}
</style>